package org.springside.examples.miniweb.web.user;

import org.springframework.beans.factory.annotation.Required;
import org.springside.examples.miniweb.entity.user.Role;
import org.springside.examples.miniweb.service.user.UserManager;
import org.springside.modules.web.struts2.CRUDAction;

/**
 * 继承于CRUDAction的极简单CRUD模块.
 * 
 * @see CRUDAction
 * @author calvin
 */
@SuppressWarnings("serial")
public class RoleAction extends CRUDAction<Role> {

	private UserManager userManager;

	private Integer id;

	@Override
	protected Object getManager() {
		return userManager;
	}

	@Override
	protected Integer getId() {
		return id;
	} 

	@Required
	public void setUserManager(UserManager userManager) {
		this.userManager = userManager;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Override
	protected void onDisplayPrepare()
	{
		this.pageSize=0;
		this.pageIndex=0;
	}
}
